<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Voyager Backend - Group Management</title>
<script type="text/javascript" src="../lib/angular/angular.min.js"></script>
<script src="http://code.angularjs.org/1.2.1/angular-route.min.js"></script>
<link rel="stylesheet" type="text/css" href="../app/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css"
	href="../app/css/bootstrap-responsive.min.css">
<link rel="stylesheet" type="text/css" href="../app/css/main.css">
<link rel="stylesheet" type="text/css"
	href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
</head>
<body ng-app="myApp">


		<div class="container">
			<div class="main row">
				<div class="col-xs-3" ng-controller="homeCtrl">
					<ul class="list-group">
						<li class="list-group-item"><a href="#/home"> <span
								class="glyphicon glyphicon-home"></span></a></li>

						<li ng-repeat="item in menu" class="list-group-item"><a
							href="{{item.href}}"> {{item.link}}</a></li>
                        <li class="list-group-item"><a href="#" ng-click="logout()"> <span
								class="glyphicon glyphicon-log-out"></span></a></li>

					</ul>
				</div>
				<div class="col-xs-9 panel panel-default" ng-controller="groupCtrl" data-ng-init="init()">
					<div ng-show="list_group_visible(1)">
						<caption>
							<h1>List of groups</h1>
						</caption>
                        <div class="col-sm-2" style="padding-left:0px;">Search group :</div>
                        <div class="col-sm-10" style="padding-left:0px;"><input type="text" ng-model="search1" ng-change="filter_group()"
									 placeholder="Search"></div>
                      <!--  <table border="0">
							<tr>
								<td>Search group : </td>
								<td> <input type="text" ng-model="search1" ng-change="filter_group()"
									 placeholder="Search"></td>
							</tr>
						</table>  -->

						<table class="table table-striped">

							<thead>
								<tr>
									<th>Name</th>
									<th>Interest</th>
									<!-- <th>Owner id</th> -->
                                    <th>Active</th>
									<th>View</th>
								</tr>
							</thead>
							<tbody>
							   <!-- <tr ng-repeat="v in a | filter:search1" ng-click="group_go(v[7],0)" class="tr"> -->
								<tr ng-repeat="v in filtered = (a | filter:search1 ) |  startFrom:(currentPage-1)*entryLimit | limitTo:entryLimit"  class="tr">
									<td>{{v[1]}}</td>
									<td>{{v[2]}}</td>
                                    <td><span class="glyphicon glyphicon-ok"></span></td>
									<!-- 	<td>{{v[6]}}</td>   ng-click="group_go(v[0],0,1,0)"-->
									<td><a href="#/group_detail/{{v[0]}}"> <span
											class="glyphicon glyphicon-arrow-right"></span></td>
								</tr>

							</tbody>
						</table>

						<div>

							<nav>
								<ul class="pager">
									<li ng-hide="disablePrev" id="nav"><a href="#/group"
										ng-click="previousPage()">Previous</a></li>
									<li ng-hide="disableNext" id="nav1"><a href="#/group"
										ng-click="nextPage()">Next</a></li>
								</ul>
							</nav>

						</div>
                          


					</div>


					<div ng-show="group_detail_visible(1)">
						<caption>
							<h1>Group detail</h1>
						</caption>
						<div class="form-group">
							<label class="col-sm-8 control-label"></label>
							<div class="col-sm-4">
								<p class="form-control-static">
									<a href="#/group" ng-click="return_group_detail(null,1)"> <span
										class="glyphicon glyphicon-arrow-left"></span></a>
								</p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label" id="label">Group name</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">{{group.data.name}}</p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Description</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">{{group.data.description}}</p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Interest</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">{{group.data.interest}}</p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Address</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">{{group.data.address}}</p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Location</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">
								
								     <iframe width="300" height="170" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?q={{long}},{{lat}}&hl=es;z=14&amp;output=embed"></iframe><br />
                                   
								</p>
							</div>
						</div>
						
                        <div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Public</label>
							<div class="col-sm-10">
								
								<div ng-switch on="group.data.privacy">
											<div ng-switch-when="1">
											   <span class="glyphicon glyphicon-ok"></span>
											   
											</div>
											<div ng-switch-default>
											   <span class="glyphicon glyphicon-remove"></span>
											</div>
										</div>
								<p class="" style="padding-top: 0px;"> 
								</p>
							</div>
						</div>
                       
						<div class="form-group">
                          <label class="col-sm-2 control-label"  id="label">
                           <div ng-switch on="group.data.privacy">
                               <div ng-switch-when="1">
                                  Searchable
                               </div>
                               <div ng-switch-default>
                               </div>
                           </div>
                         </label> 
							
							<div class="col-sm-10">
								
									<div ng-switch on="group.data.privacy">
											<div ng-switch-when="1">
											    <div ng-switch on="group.data.searchable">
										         	 <div ng-switch-when="1">
											            <span class="glyphicon glyphicon-ok"></span>
											   
											         </div>
											        <div ng-switch-default>
											            <span class="glyphicon glyphicon-remove"></span>
											         </div>
										         </div>
											   
											</div>
											<div ng-switch-default>
											  
											</div>
										</div>
								   
								   

                                      
								<p class="" style="padding-top: 0px;"> 
								</p>
							</div>
						</div>
								   
						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Owner</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">

									<a href="#/group" ng-click="go_user_detail(owner.data.id,1)"><i class="fa fa-shield"></i>
										{{owner.data.first_name}} {{owner.data.last_name}}</a>
								</p>
							</div>
						</div>		   
							
						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">List of {{nb_users}} member(s)</label>
							<div class="col-sm-10"
								style="padding-left: 0px; padding-top: 0px;">

								<ul class="list-group" style="margin-left: 13px;"">
                                  <!-- 
									<li ng-repeat="item in lst_user.data.members_list"
										class="list-group-item" style="width: 70%"><a href="#"
										ng-click="go_user_detail(item.id,1)">{{item.name}} 
									</a></li>  -->
									
									
									<li ng-repeat="item in b"
										class="list-group-item" style="width: 70%"><a href="#/group"
										ng-click="go_user_detail(item[1],1)">{{item[0]}}
									</a></li>

								</ul>

							</div>
							
							<div>

								 <nav>
									<ul class="pager">
										<li ng-hide="disablePrev_group"><a href="#/group"
											ng-click="previousPage_group()">Previous</a></li>
										<li ng-hide="disableNext_group"><a href="#/group"
											ng-click="nextPage_group()">Next</a></li>
									</ul>
								</nav>

						    </div> 
						</div>  


					</div>


                   
                    <div ng-show="is(1)">
						<caption>
							<h1>User detail</h1>
						</caption>
						<div class="form-group">
							<label class="col-sm-9 control-label"></label>
							<div class="col-sm-3">
								<p class="form-control-static">
									<a href="#/group" ng-click="return_(null,1)"> <span
										class="glyphicon glyphicon-arrow-left"></span></a>
								</p>
							</div>
						</div>

                        <div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Last Name</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">{{owner.data.last_name}}</p>
							</div>
						</div>

						<div class="form-group">
							<label class="control-label col-sm-2"  id="label">First Name</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">{{owner.data.first_name}}</p>
							</div>
						</div>


						

						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Email</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">{{owner.data.email}}</p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Login Type</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">{{owner.data.login_type}}</p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label" style="padding-top: 5px;">Status</label>
							<div class="col-sm-10">

 									  <div ng-switch on="owner.data.blocked_flg" >
											<div ng-switch-when="1">Inactive 
											   <button type="button" class="btn btn-success" confirmed-click="lock(owner.data.id,1)" ng-confirm-click="Would you like to unlock this user?"> UnLock</button>
                                            </div>
											<div ng-switch-when="0">Active   
											   <button type="button" class="btn btn-danger" confirmed-click="lock(owner.data.id,0)" ng-confirm-click="Would you like to lock this user?">Lock</button>
											</div>
										</div>
 
                               		  <p class="" style="padding-top: 0px;" >
                                      </p>
                                      
							</div>

                          </div>

						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Avatar</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">
									<img src="{{owner.data.avatar_url}}" class="img-responsive"
										alt="{{owner.data.first_name}}">
								</p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label">Interests</label>
							<div class="col-sm-10">
								<p class="form-control-static" style="padding-top: 0px;">
									<!-- 
							  <ul class="class="list-group">
							  
							      <li ng-repeat="item in user.data.interests" class="list-group-item list-group-item-success"> {{item}}  </li>
							    
							  </ul>  -->


									<span data-ng-repeat="item in owner.data.interests">{{item}}<span
										ng-show="!$last">, </span></span>

								</p>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 control-label"  id="label">Groups</label>
							<div class="col-sm-10"
								style="padding-left: 0px; padding-top: 0px;">

								<ul class="list-group" style="margin-left: 13px;"">
                                   <!-- 
									<li ng-repeat="item in groups.data.groups_list"
										class="list-group-item" style="width: 70%">
										<a href="#"
										ng-click="group_go(item.id,0,2)">{{item.name}} - {{item.id}}
									</a>
										
									</li> -->
									
									<li ng-repeat="item in c"
										class="list-group-item" style="width: 70%">
										<a href="#/group"
										ng-click="group_go(item[1],0,2,owner.data.id)">{{item[0]}} - {{item[1]}}
									</a>
										
									</li>

								</ul>

							</div>
							
							<div>

								 <nav>
									<ul class="pager">
										<li ng-hide="disablePrev_group_" id="anchor"><a href="#/group"
											ng-click="previousPage_group_()">Previous</a></li>
										<li ng-hide="disableNext_group_" id="anchor"><a href="#/group"
											ng-click="nextPage_group_()">Next</a></li>
									</ul>
								</nav>

						    </div> 
						</div>

                            



					</div>
                   
				</div>




			</div>
		</div>

</body>
</html>